package edu.ahut.designpattern.chainresponsibility.demo;

import java.math.BigInteger;

/**
 * 输入一个整数n计算出n的阶乘
 */
public class Demo {
    public static void main(String[] args) {
        int n = 2;
        //int s = 1;
        //long s=1;
        BigInteger s=new BigInteger("1");
        for (int i = 2; i <= n; i++) {
            s = s.multiply(new BigInteger(Integer.toString(i)));
        }
        System.out.println(s);
    }
}
